<?php
$options = array(
	'speed'=>1000,
	'pause'=>8000,
	'animation'=>'fade',
	'showItems'=>1,
	'height'=>0,
	'direction'=>'up',
);
EvTicker::add('#sticky', $options);
$baseUrl = Yii::app()->request->baseUrl . '/images/fugue';
$unsticky = "<img src=\"$baseUrl/pin--minus.png\" />";
$unstickiable = Yii::app()->user->checkAccess('newsUnsticky');
?>
<div id="sticky">
	<ul style="width: 100%;">
		<?php foreach ($dataProvider->data as $data): ?>
			<li style="border-bottom: none;">
				<?php
				$widget = 'zii.widgets.CMenu';
				if (!Yii::app()->user->isGuest) {
					$properties = array(
						'items'=>array(
							array(
								'label'=>$unsticky,
								'url'=>array(
									'news/unsticky',
									'id'=>$data->_id,
								),
								'linkOptions'=>array('title'=>'Unsticky'),
								'visible'=>$unstickiable,
							),
						),
						'htmlOptions'=>array('class'=>'operations',),
						'encodeLabel'=>false,
					);
					$this->widget($widget, $properties);
				}
				?>
				<div><b><?php echo $data->senderMinimal; ?></b></div>
				<div><?php echo nl2br(CHtml::encode($data->value)); ?></div>
				<p />
			</li>
		<?php endforeach ?>
	</ul>
</div>
